<{include file="../common/header.tpl"}>
<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
            <{include file="../common/left.tpl"}>
    </td>
    <td width="87%" valign="top">
        <table width="100%" border="0" cellspacing="0">
            <tr>
                <td>
                    <div class="subnav">
                        <div class="content-menu ib-a blue line-x"> 
                            <a href="#" class="on"><em>权限分配</em></a></a>
                        </div>
                      </div>
                    <div class="pad_10">
                        <div class="table-list">
                            <form name="form1" action="/webadmin/group/doauth" method="post">
                                <table width="100%" cellspacing="0">
                                      <tbody>
                                       <{foreach $auth as $key => $val}>
                                        <tr onMouseOver="this.className='tr2'" onMouseOut="this.className='tr1'" class="tr1">
                                            <td valign="middle">
                                                <input type="checkbox" name="auth[]" value="<{$val.controller}>" id="v<{$key}>" onclick="selall(this);"/><{$val.name}></td>
                                        </tr>
                                        <{if $val.sub}>
                                            <tr onMouseOver="this.className='tr2'" onMouseOut="this.className='tr1'" class="tr1">
                                              <td style="padding-left:25px;">
                                                  <{foreach $val.sub as $k => $v}>
                                                  <input type="checkbox" name="auth[]" value="<{$v.action}>" class="v<{$key}>" ><{$v.name}>&nbsp;&nbsp;
                                                  <{/foreach}>
                                              </td>
                                            </tr>
                                            
                                        <{/if}>
                                        <{/foreach}>
                                      </tbody>
                                </table>
                                      <input type="hidden" name="group_id" value="<{$group_id}>" />
                                      <input type="submit" value="提交" />
                                </form>
                        </div>
                      </div>
                </td>
            </tr>
        </table>
    </td>
 </tr>
</table>
<script>
function selall(obj){
    var val= $(obj).attr('id'); 
    alert($(obj).attr("checked"));
    if ($(obj).attr('checked')){
        $('.'+val).attr('checked',true);
    } else {
        $('.'+val).attr('checked',false);
    }
}
</script>
<{include file="../common/footer.tpl"}>